using System;
using System.Collections.Generic;
using System.Text;

namespace Home.Controls
{
    public class TreeListNodeData : Dictionary<string,string>
    {
        /// <summary>
        /// Get TreeListNodeData Value(if it is not exist return empty)
        /// </summary>
        /// <param name="strKey">Key</param>
        /// <returns>Value</returns>
        public string GetValue(string strKey)
        {
            string strResult = string.Empty;
            base.TryGetValue(strKey, out strResult);
            return strResult;
        }

        /// <summary>
        /// Set TreeListNodeData Value(if it is exist edit it's value)
        /// </summary>
        /// <param name="strKey">Key</param>
        /// <param name="strValue">Value</param>
        public void SetValue(string strKey, string strValue)
        {
            if(base.ContainsKey(strKey))
            {
                base[strKey] = strValue;
            }
            else
            {
                base.Add(strKey, strValue);
            }
            
        }
    }
}
